<div id="page-content">
  <div id='wrap'>
    <div id="page-heading">
      <ol class="breadcrumb">
        <li><a href="index.php">Dashboad</a></li>
        <li>Data Hewan</li>
      </ol>

      <h1>Data Hewan</h1>
    </div>


    <div class="container">
     <br />
     <br />
     <div class="panel-body collapse in">
       <div class="col-md-12">
        <a href="<?php echo site_url('hewan/cetak_excel'); ?>" class="btn btn-green"><i class="icon-excel"></i> Cetak Excel</a>
        <br/>
        <br/>
      </div>
      <div class="row">
        <div class="col-md-12">
          <div class="panel panel-sky">
            <div class="panel-heading">
              <h4>Data Hewan</h4>
            </div>
            <div class="panel-body collapse in">
              <table cellpadding="0" cellspacing="0" border="0" class="table table-striped table-bordered datatables" id="example">
                <thead>
                  <tr>
                    <th>No</th>
                    <th>Nama Pemilik</th>
                    <th>Jenis</th>
                    <th>Berat</th>
                    <th>Umur</th>
                    <th>Pemeriksa</th>
                    <th>Tgl Periksa</th>
                    <th>Aksi</th>
                  </tr>
                </thead>
                <tbody>
                 <?php 
                 $i = 0;
                 if ($data != null) 
                  foreach ($data as $dt) {  $i++; 
                    if($dt->jenis_hewan == 1){
                      $dt->jenis_hewan = 'Sapi';
                    }
                    if($dt->jenis_hewan == 2){
                      $dt->jenis_hewan = 'Kambing';
                    }
                    if($dt->jenis_hewan == 3){
                      $dt->jenis_hewan = 'Domba';
                    }
                    ?>

                    <tr>
                      <td><?php echo $i; ?></td>
                      <td><?php echo $dt->nama; ?></td>
                      <td><?php echo $dt->jenis_hewan; ?></td>
                      <td><?php echo $dt->berat; ?></td>
                      <td><?php echo $dt->umur; ?></td>
                      <td><?php echo $dt->namapemeriksa; ?></td>
                      <td><?php echo $dt->tgl_periksa; ?></td>
                      <td>
                       <div class="btn-group">
                        <a href="#" class="btn btn-default-alt dropdown-toggle" data-toggle="dropdown">Aksi<span class="caret"></span> </a>
                        <ul class="dropdown-menu" role="menu">

                          <li><a href="<?php echo site_url('hewan/hapus').'/'.$dt->id_periksa; ?>" onclick="return confirm('Anda yakin ingin menghapus data ?');">Hapus</a></li>
                        </ul>
                      </div>
                    </td>
                  </tr>
                  <?php } ?>
                </tbody>
              </table>
            </div>
          </div>
        </div>
      </div>

    </div> <!-- container -->
  </div> <!--wrap -->
</div> <!-- page-content -->